﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BlogManager.Application.Controls
{
    public partial class MenuForSelectedSite : System.Web.UI.UserControl
    {
        private int? SiteId;
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!string.IsNullOrEmpty(Request.QueryString["SiteId"]))
                SiteId = Convert.ToInt32(Request.QueryString["SiteId"]);

            this.Visible = (SiteId != null);
            HyperLinkForPages.NavigateUrl = "~/Application/Pages.aspx?SiteId=" + Request.QueryString["SiteId"];
            HyperlinkForAddingPages.NavigateUrl = "~/Application/Page.aspx?SiteId=" + Request.QueryString["SiteId"];

            HyperLinkForBlogs.NavigateUrl = "~/Application/BlogPosts.aspx?SiteId=" + Request.QueryString["SiteId"];
            HyperlinkForAddingABlogPost.NavigateUrl = "~/Application/Post.aspx?SiteId=" + Request.QueryString["SiteId"];
        }
    }
}